package com.mybatis;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class IntegerTypeHandle implements TypeHandler<Integer> {

    @Override
    public void setParameter(PreparedStatement prepareStatement, int index, Integer parameterValue) {
        try {
            prepareStatement.setInt(index, parameterValue);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public Integer getResult(ResultSet rs, String colum) throws SQLException {
        return rs.getInt(colum);
    }
}
